home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2007 June
/
PCWorld_2007-06_cd.bin
/
zabezpeceni
/
spyeraser
/
spyeraser.exe
/
{app}
/
SpyEraser.dll
/
2110
/
PHOTOUTILS.JS
< prev
next >
Wrap
Text File
|
2007-04-23
|
1KB
|
46 lines
// correctly handle PNG transparency in Win IE 5.5 & 6.
function handleTransparency()
{
var b = navigator.appVersion.split("MSIE");
var v = parseFloat(b[1]);
if (v >= 5.5 && document.body.filters)
{
for(var i=0; i<document.images.length; i++)
{
var img = document.images[i];
var imgName = img.src.toLowerCase();
if(imgName.substring(imgName.length-3, imgName.length) == "png")
{
var imgID = (img.id) ? "id='"+ img.id +"' " : "";
var imgClass = (img.className) ? "class='"+ img.className +"' " : "";
var imgTitle = (img.title) ? "title='"+ img.title +"' " : "title='"+ img.alt +"' ";
var imgStyle = "display: inline-block;"+ img.style.cssText;
switch(img.align)
{
case "left":
imgStyle += "float: left;";
break;
case "right":
imgStyle += "float: right;";
break;
default:
break;
}
if(img.parentElement.href) imgStyle = "cursor: hand;"+ imgStyle;
var strNewHTML = "<span "+ imgID + imgClass + imgTitle
+" style=\""+ "width:"+ img.width +"px; height:"+ img.height +"px;"+ imgStyle +";"
+"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
+"(src=\'btn_help_selected.png\', sizingMethod='scale');\"></span>";
img.outerHTML = strNewHTML;
document.write (strNewHTML);
alert(strNewHTML);
i-=1;
}
}
}
}